//
//  InpatientHealthyViewModel.m
//  HonlivApp
//
//  Created by admin on 2017/6/27.
//  Copyright © 2017年 honliv. All rights reserved.
//

#import "InpatientHealthyViewModel.h"
#import "InpHealthyModel.h"

@implementation InpatientHealthyViewModel

-(void)getInHealthyInfo:(void (^)())completion{
    NSDictionary *info = @{@"db":@"OracleString",@"SqlNo":@"1",@"patient_id":[User currentUser].patientId};
    NSString *url = [NSString stringWithFormat:@"%@%@",HOSPITAL_URL,COMMON_URL_NOPAGE];
    [NetWorker getCommonDatasWithURLStr:url body:info success:^(id result) {
        NSArray *resultArr = [JsonHelper arrayWithJsonString:result[@"Entity"]];
        NSMutableArray *modelArr = [NSMutableArray array];
        for (NSString *jsonStr in resultArr) {
            InpHealthyModel *model = [InpHealthyModel yy_modelWithJSON:jsonStr];
            [modelArr addObject:model];
        }
        _datasArray = modelArr;
        completion(modelArr);
    } failure:^(id result) {
        completion([NSArray array]);
    }];

}

@end
